package com.gc.server.service;

import com.gc.server.entity.ApplyEntity;
import com.gc.server.entity.BusApplyEntity;
import com.gc.server.vo.ApplyUserVo;
import com.gc.server.vo.BusApplyVo;
import com.gc.server.vo.CostApplyVo;
import com.yf.service.BaseService;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 申请Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Apr 08 09:33:59 CST 2020
 */
public interface BusApplyService extends BaseService<BusApplyEntity> {


    List<BusApplyVo> queryListVo(BusApplyVo busApplyVo);

    BusApplyVo getVo(Long id);


    /***********BACK***********/

    /***********API***********/


    /**
     * 申请
     *
     * @param userId
     * @param info
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    ApplyEntity apply(Long userId, String info, List<BusApplyEntity> applyEntities);

    void downLoad(HttpServletResponse response, List<BusApplyVo> list);

    BusApplyEntity applyLeave(Long userId,String info,Date startDate, Date endDate,Integer type,Integer leaveType,BigDecimal hours);

    /**
     * 审核
     *
     * @param userId
     * @param id
     * @param status
     * @return
     */
    BusApplyEntity check(Long userId, Long id, Integer status, String remark);

    /**
     * 找出下面所有的申请
     *
     * @param userId
     * @return
     */
    List<ApplyUserVo> findMyShopUser(Long userId);

    List<ApplyUserVo> findMyShopUserAndDate(Long topUserId,Long userId,Date startDate,Date endDate);

    /**
     * 找出自己所有的申请
     * @param userId
     * @return
     */
    List<ApplyUserVo> findByUser(Long userId);

    List<ApplyUserVo> findByUserAndDate(Long userId,Date startDate,Date endDate);

    BigDecimal calHours(Date start,Date end);

    Integer sumCheck(Long userId,Integer type);

    List<BusApplyEntity> findByAid(Long id);
}
